<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>8-5</title>
</head>

<body>
    <p>2019年12月30日<span class="hour">14</span>：<span class="minute">08</span>：<span class="second">23</span></p>
    <script>
        window.setInterval(showtime, 1000);

        function showtime() {
            var hour = document.querySelector('.hour');
            var minute = document.querySelector('.minute');
            var second = document.querySelector('.second');
            var today = new Date();
            hour.innerHTML = today.getHours();
            minute.innerHTML = today.getMinutes();
            second.innerHTML = today.getSeconds();
        }
    </script>
</body>

</html>